package com.hujiheng.paike.service.impl;

import com.hujiheng.paike.mapper.CourseMapper;
import com.hujiheng.paike.pojo.Course;
import com.hujiheng.paike.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseServiceImpl implements CourseService {
    @Autowired
    private CourseMapper courseMapper;

    @Override
    public Course getCourseById(int courseId) {
        return courseMapper.getCourseById(courseId);
    }

    @Override
    public Course getCourseByName(String courseName) {
        return courseMapper.getCourseByName(courseName);
    }

    @Override
    public List<Course> getCourseList() {
        return courseMapper.getCourseList();
    }

    @Override
    public int addCourse(Course course) {
        return courseMapper.addCourse(course);
    }

    @Override
    public int delCourse(int courseId) {
        return courseMapper.delCourse(courseId);
    }
}
